import { defineRequest } from "../common";
import { IAdventureInfo, ICharacterInfo } from "./type";

export default defineRequest((request) => {
  return {
    getToken(alter: string, version?: string, equVersion?: string) {
      return request
        .get<string>(`/token/get/${alter}`, { params: { equVersion } })
        .then((r) => r.data);
    },
    getCharacter() {
      return request.get<ICharacterInfo>("/character").then((r) => r.data);
    },
    adventures() {
      return request.get<IAdventureInfo[]>("/adventure");
    },
  };
});
